package thread;

import org.w3c.dom.ls.LSOutput;

public class SymcDemo3 {
    public static void main(String[] args) {
        Thread t1 = new Thread(){
            public void run(){
                Boo.doSome();
            }
        };
        Thread t2 = new Thread(){
            public void run(){
                Boo.doSome();
            }
        };
        t1.start();
        t2.start();

    }
}
class Boo{
   /* public synchronized static void doSome(){
        Thread t = new Thread();
        System.out.println(t+"正在执行doSome方法");
        try {
            Thread.sleep(5000);
        } catch (InterruptedException e) {

        }
        System.out.println(t+"执行doSome方法完毕");


    }
*/
   public  static void doSome(){
      synchronized (Boo.class){
          Thread t = new Thread();
          System.out.println(t+"正在执行doSome方法");
          try {
              Thread.sleep(5000);
          } catch (InterruptedException e) {

          }
          System.out.println(t+"执行doSome方法完毕");
      }
   }

}
